import { defineConfig, Format, Options } from "tsup"

const defaultConfig = {
  sourcemap: true,
  clean: true,
  dts: true,
  shims: true,
  treeshake: true,
  // minify: true, // 压缩打包后的代码
  target: 'esnext' as unknown as Options['target'],
  format: ['cjs', 'esm'] as unknown as Format,
}

export default defineConfig([
  {
    entry: {
      index: 'src/index.ts'
    },
    outDir: 'dist/',
    ...defaultConfig,
  },
])
